package hibernate.model;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.NamedQueries;
import org.hibernate.annotations.NamedQuery;

@SuppressWarnings("serial")
@Entity
@Table(name = "hatacozumu", catalog = "emmy")
@NamedQueries({  // Şimdilik bu query'lere gerek yok ihtiyaç olursa diye hazırlandı...
@NamedQuery(name = "findHataCozumHtKodu", 	 query = "from Hatacozumu where hataKodu = :hHataKodu"),
@NamedQuery(name = "findHataCozumAygtid", 	 query = "from Hatacozumu where aygitid = :hAygtid"),
@NamedQuery(name = "findHataCozumUretid", 	 query = "from Hatacozumu where ureticiid = :hUreticiid"),
@NamedQuery(name = "findHataCozumCzAcklama", query = "from Hatacozumu where cozumAciklamasi like :hCzAcklama"),
})
public class Hatacozumu implements java.io.Serializable {

	private long htid;
	private Sirketprofil sirketprofil;
	private Aygit aygit;
	private String hataKodu;
	private String cozumAciklamasi;

	public Hatacozumu() {
	}

	public Hatacozumu(Sirketprofil sirketprofil, Aygit aygit, String hataKodu, String cozumAciklamasi) {
		this.sirketprofil = sirketprofil;
		this.aygit = aygit;
		this.hataKodu = hataKodu;
		this.cozumAciklamasi = cozumAciklamasi;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "htid", unique = true, nullable = false)
	public long getHtid() {
		return this.htid;
	}

	public void setHtid(long htid) {
		this.htid = htid;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "ureticiid", nullable = false)
	public Sirketprofil getSirketprofil() {
		return this.sirketprofil;
	}

	public void setSirketprofil(Sirketprofil sirketprofil) {
		this.sirketprofil = sirketprofil;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "aygitid", nullable = false)
	public Aygit getAygit() {
		return this.aygit;
	}

	public void setAygit(Aygit aygit) {
		this.aygit = aygit;
	}

	@Column(name = "hataKodu", nullable = false, length = 20)
	public String getHataKodu() {
		return this.hataKodu;
	}

	public void setHataKodu(String hataKodu) {
		this.hataKodu = hataKodu;
	}

	@Column(name = "cozumAciklamasi", nullable = false, length = 200)
	public String getCozumAciklamasi() {
		return this.cozumAciklamasi;
	}

	public void setCozumAciklamasi(String cozumAciklamasi) {
		this.cozumAciklamasi = cozumAciklamasi;
	}
}